﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VideoIndexViewModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<%if (Model.Videos != null && Model.Videos.Count > 0)
     {
         var first = Model.Videos[0]; %> 
<div class="art_top pad">
    <div class="art_top_l">
        <a href="/video/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Name)%>">
            <% string imgPath = (first.ImagePath != null && first.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(first.ID, 300, 225, first.ImagePath, Model.VideoImagePath, Model.VideoImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
            <img src="<%=imgPath %>" title="<%=first.Name %>" alt="<%=first.Name %>" class="bor_img" width="300" height="225" style="overflow:hidden"/>
        </a>
    </div>
    <div class="art_top_r">
        <div class="art_top_r_txt_hd">
            <h3><a href="/video/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Name)%>" class="link_org"><%=Html.Encode(first.Name) %></a></h3>
        </div>
        <div class="datetime" style="margin-top: 6px;"><%=first.AddDate.HasValue ? (first.AddDate.Value.ToString("hh:mm") + "&nbsp;|&nbsp;" + first.AddDate.Value.ToString("dd/MM/yyyy")) : string.Empty%></div>
        <div class="art_top_r_txt_ct">
             <%= first.Description%>
        </div>
    </div>
</div>
<div class="clear"></div>
<%if (Model.Videos.Count > 1)
    {%>
    <div class="duan_list">
    <ul>
	    <%for (int i = 1; i < Model.Videos.Count; i++)
       {
           string imgPath1 = !string.IsNullOrEmpty(Model.Videos[i].ImagePath) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Videos[i].ID, 70, 56, Model.Videos[i].ImagePath, Model.VideoImagePath, Model.VideoImageUrl) : SDT.Lib.Common.Globals.DefaultLogo;
           %>
	    <li>
    	    <a href="/video/details/<%=Model.Videos[i].ID %>/<%=Html.ToUrlFriendly(Model.Videos[i].Name)%>">
            <img class="bor_img" src="<%=imgPath1 %>" title="<%=Model.Videos[i].Name %>" alt="<%=Model.Videos[i].Name %>" width="132" height="96" /></a>
            <div><a href="/video/details/<%=Model.Videos[i].ID %>/<%=Html.ToUrlFriendly(Model.Videos[i].Name)%>"><strong><%=Html.Encode(Model.Videos[i].Name)%></strong></a></div>
        </li>
        <%}%>
       
    </ul>
    </div>
    <%}%>
<%} %>
<div class="clear"></div>
